package com.hzspace.cors1;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: LiuHao
 * @Descirption:
 * @Date: 2020/2/29_22:24
 */
@RestController
//@CrossOrigin(origins = "http://localhost:8081")
public class HelloController {

    @GetMapping("/hello")
//    @CrossOrigin(origins = "http://localhost:8081")
    public Object hello(){
        return "Hello Cors!";
    }

    @PutMapping("/hello")
//    @CrossOrigin(origins = "http://localhost:8081")
    public Object put(){
        return "Do Put!";
    }
}
